*** Settings ***
Documentation    TC02-Data Cleaning LCL Project By Location
Resource    ../../Keywords/Common_Head.robot
Force Tags    P1
Metadata    Author    Nella
Metadata    ID    6850936


*** Test Cases ***
TC02-Data Cleaning LCL Project By Location
    Step 1 User Goes To Basic Data Management Tender List
    Step 2 User Goes To Pricing Collaboration Pricing Project
    Step 3 Input Following Attributes
    Step 4 User Select The Row Which Project Name Is 20240815 LCL
    Step 5 User Clicks Data Cleaning Button
    Step 6 User Clicks Upload Button
    Step 7 User Clicks Add File Button And Select The File
    Step 8 User Select Location Routing
    Step 9 User Clicks Start Button
    Step 10 User Clicks Download Button
    Step 11 Check The Values Of Download File With The Original
    Step 12 Modify The Download File And User Clicks Upload Button
    Step 13 User Click Start Button
    Step 14 User Click Download Button
    Step 15 User Clicks Close Button
    Step 16 User Clicks Yes When Asking Are You Sure To Close This
    Step 17 In Pricing Project Page User Selects TenderID Contains
    Step 18 Select This Project Click On Delete Project Button
    Step 19 User Goes To Basic Data Management Tender List Step 19



*** Keywords ***
Step ${step} User Goes To Basic Data Management Tender List
    #************************Step 1******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Click Create button
    #      Input with following attributes
    #      Tender ID some numbers such as 202408151435001 you can
    #     input with current datetime and some random number to
    #     avoid duplicate validation
    #      Tender Title some value such as Regression Test by
    #     Wendy001
    #      Customer 815 Miele
    #      Mode select all
    #      Level Global
    #      Click on Save button
    #  Expected:
    #      Created successfully with the message Tender has been
    #     added
    #************************************************************
    ${G_TENDERID}    Generate Tender ID
    ${TenderTitle}   Set Variable    Regress
    Set Test Variable     ${G_TENDERID}
    ${CurDate}    Get Current Date    result_format=%d/%m/%Y
    ${FutureDate}    Get Current Date    UTC    +10days    result_format=%d/%m/%Y
    ${validToDate}    Get Current Date    UTC    +100days    result_format=%d/%m/%Y
    ${PROJECT}    Copy Dictionary    ${PROJECT_PARAM}
    Set To Dictionary    ${PROJECT}
    ...    TENDER_ID=${G_TENDERID}    TENDER_TITLE=${TenderTitle}    CUSTOEMR_NAME=Miele    CUSTOMER_LEVEL=Global
    ...   MODE=LCL    DEADLINE_TM_DATE=${FutureDate}    VALID_FROM=${CurDate}    VALID_TO=${validToDate}    
    ...    DEPUTY=NATZHANG      TEMPLATE=${CURDIR}${/}TestData${/}LCLTemplate-Location-all.xlsx
    Set Suite Variable    ${PROJECT}
    Login Space
    Create Tender    ${G_TENDERID}    Regress    815    true    true    true

Step ${step} User Goes To Pricing Collaboration Pricing Project
    #************************Step 2******************************
    #  Do:
    #      User goes to Pricing Collaboration Pricing Project
    #      User clicks Create Project button
    #  Expected:
    #      A New Project dialog should be opened successfully
    #************************************************************
    Create Project   ${PROJECT}

Step ${step} Input Following Attributes
    #************************Step 3******************************
    #  Do:
    #      Input following attributes
    #      Tender ID 20240815 Regression
    #      Mode FCL
    #      Deadline to TM current date 10 day
    #      Rate Validity From current date
    #      Rate Validity To current date 100 day
    #      Deputies NATZHANG
    #      Description for regression
    #      Click on Save button
    #  Expected:
    #      Save successfully
    #************************************************************
    log    done

Step ${step} User Select The Row Which Project Name Is 20240815 LCL
    #************************Step 4******************************
    #  Do:
    #      User select the row which project name is 20240815 LCL
    #     Regression
    #  Expected:
    #      The row is selected and the button of data cleaning is
    #     enabled
    #************************************************************
    log    done

Step ${step} User Clicks Data Cleaning Button
    #************************Step 5******************************
    #  Do:
    #      User clicks data cleaning button
    #  Expected:
    #      A dialogue named 20240815 LCL Regression shows
    #     successfully
    #************************************************************
    Data Cleaning

Step ${step} User Clicks Upload Button
    #************************Step 6******************************
    #  Do:
    #      User clicks upload button
    #  Expected:
    #      A dialogue name Upload Template shows successfully
    #************************************************************
    log    done

Step ${step} User Clicks Add File Button And Select The File
    #************************Step 7******************************
    #  Do:
    #      User clicks add file button and select the file
    #     LCLTemplate Location All xlsx form local
    #  Expected:
    #      A table shows below upload button It contains document
    #     name and date time Document name is LCLTemplate Location
    #     All xlsx date time is you uploaded time like 03 10 2024
    #     17 05
    #************************************************************
    log    done

Step ${step} User Select Location Routing
    #************************Step 8******************************
    #  Do:
    #      User select location routing
    #      Select all of them
    #      User select map columns like that
    #      Origin Country country from D
    #      Destination Country country to G
    #      Origin City city from C
    #      Destination City city to F
    #      Origin State state from E
    #      Destination State state to H
    #      Origin Type origin type l
    #      Destination Type des type J
    #      Origin Postal Code Origin Postal Code K
    #      Destination Postal Code Destination Postal Code L
    #      Customer Lane ID Lane ID code B
    #      Customer CFS Hub Gateway Origin Customer CFS origin N
    #      Customer CFS Hub Gateway Destination Customer CFS Des O
    #      Number of Shipments number of shipments P
    #      Weight in Metric Tons weight in metric tons Q
    #      Volume in cbm volume in cbm R
    #      Commodity Description commodity description S
    #      IMO Class IMO Class T
    #      IMO UN No IMO UN No U
    #  Expected:
    #      They both should be select successfully
    #************************************************************
    log    done

Step ${step} User Clicks Start Button
    #************************Step 9******************************
    #  Do:
    #      User clicks start button
    #  Expected:
    #      In the tab of step3 validation download upload and set
    #     pass buttons appears The summary shows successful
    #************************************************************
    log    done

Step ${step} User Clicks Download Button
    #************************Step 10******************************
    #  Do:
    #      User clicks download button
    #  Expected:
    #      File download successfully
    #************************************************************
    log    done

Step ${step} Check The Values Of Download File With The Original
    #************************Step 11******************************
    #  Do:
    #      Check the values of download file with the original
    #     file LCLTemplate Location All xlsx
    #  Expected:
    #      Compare the two files the value of the same column
    #     which selected in step 8 should be equal except state
    #************************************************************
    log    done

Step ${step} Modify The Download File And User Clicks Upload Button
    #************************Step 12******************************
    #  Do:
    #      Modify the download file and user clicks upload button
    #      such as update column Commodity Remarks value to be
    #     test updated
    #  Expected:
    #      The start button appears
    #************************************************************
    Modify and Check Data Cleaning

Step ${step} User Click Start Button
    #************************Step 13******************************
    #  Do:
    #      User click start button
    #  Expected:
    #      Wait a few seconds there is a successful prompt below
    #     the buttons like that Summary Successful
    #      Please close this page and go to Generate Internal
    #     Pricing Template
    #************************************************************
    log    done

Step ${step} User Click Download Button
    #************************Step 14******************************
    #  Do:
    #      User click download button
    #  Expected:
    #      File download successfully Check the modified area the
    #     values are equal with the modified values
    #************************************************************
    log    done

Step ${step} User Clicks Close Button
    #************************Step 15******************************
    #  Do:
    #      User clicks close button
    #  Expected:
    #      A warning dialogue display and ask you Are you sure to
    #     close this page
    #************************************************************
    log    done

Step ${step} User Clicks Yes When Asking Are You Sure To Close This
    #************************Step 16******************************
    #  Do:
    #      User clicks yes when asking Are you sure to close this
    #     page
    #  Expected:
    #      The dialogue disappears
    #************************************************************
    log    done

Step ${step} In Pricing Project Page User Selects TenderID Contains
    #************************Step 17******************************
    #  Do:
    #      In Pricing Project page User selects TenderID Contains
    #     20240815
    #  Expected:
    #      The project 20240815 LCL Regression could be found
    #************************************************************
    Search Project    ${G_TENDERID}

Step ${step} Select This Project Click On Delete Project Button
    #************************Step 18******************************
    #  Do:
    #      Select this project click on Delete Project button
    #      Click Yes of the pop up confirm window
    #  Expected:
    #      System displays Project has been deleted
    #************************************************************
    log    teardown

Step ${step} User Goes To Basic Data Management Tender List Step 19
    #************************Step 19******************************
    #  Do:
    #      User goes to Basic Data Management Tender List
    #      Search out the tender created in step1
    #      Click on Delete button
    #      Click on Yes button in the popup dialog
    #  Expected:
    #      System displays Tender has been deleted
    #************************************************************
    log    teardown

